﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DemoGeometry
{
    public partial class MainForm_SCD : Form
    {
        public MainForm_SCD()
        {
            InitializeComponent();
            tCheckListControl1.Height = 1300;
        }

        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            Bitmap _NewBitmap = new Bitmap(888, 1200);
            tCheckListControl1.DrawToBitmap(_NewBitmap, new Rectangle(0, 0, _NewBitmap.Width, _NewBitmap.Height));
            //  _NewBitmap.Save(@"c:\abc.bmp");
            e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
            e.Graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
            // e.Graphics.DrawImage(_NewBitmap, 0, 0, _NewBitmap.Width, _NewBitmap.Height); 
            //e.Graphics.DrawImage(_NewBitmap, e.Graphics.VisibleClipBounds);
            e.Graphics.DrawImage(_NewBitmap, 0,0,_NewBitmap.Width, _NewBitmap.Height);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.printDocument1.Print();

        }

        private void button2_Click(object sender, EventArgs e)
        {
            //TCheckListControl Tscd;
            //Tscd = new TCheckListControl(){ title="公安县人民医院"};
            tCheckListControl1.title = "公安县人民医院";
            tCheckListControl1.ConnectDb("yxhis");
            tCheckListControl1.drawb = true;
            //Tscd.title = "公安县人民医院";
            tCheckListControl1.Refresh();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            tCheckListControl1.Height += 100;
        }

        private void button4_Click(object sender, EventArgs e)
        {
            string ls_retun;
            ls_retun = this.tCheckListControl1.VertStr("张绪舜");
            MessageBox.Show(ls_retun);
        }
    }
}
